package com.adl.entity;

import com.adl.entity.listener.MemberListener;

import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.OneToMany;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;

/**
 * Created by Adiljan on 2017-06-16.
 */
@EntityListeners(MemberListener.class)
@Entity
public class Member extends BaseEntity {

    private String name;

    private String username;

    @OneToMany(mappedBy = "member", orphanRemoval = true)
    private List<Orders> orders = new ArrayList();

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }


    public List<Orders> getOrders() {
        return orders;
    }

    public void setOrders(Vector<Orders> orders) {
        this.orders = orders;
    }
}
